//入口文件  
import Vue from "vue"
//1.1导入路由包
import VueRouter from "vue-router"
//1.2安装路由
Vue.use(VueRouter)
//1.3导入自己的router.js模块
import router from './router.js'
//导入App根组件
import App from "./App.vue"

//2.1 导入vue-resource
import VueResource from 'vue-resource'
//2.2 安装vue-resource
Vue.use(VueResource)
//2.3 配置全局根路径
Vue.http.options.root = 'http://www.liulongbin.top:3005/';

// 导入时间过滤器插件
import moment from 'moment'
// 定义全局过滤器(这里回调函数的pattren参数运用了ES6的参数默认值)
Vue.filter('dataFormat', function (dataStr, pattern = "YYYY-MM-DD HH:mm:ss"){
    return moment(dataStr).format(pattern)
})

import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'


import { Header, Swipe, SwipeItem, Button } from 'mint-ui'
Vue.component(Header.name, Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);

var vm = new Vue ({
    el: '#app',
    render: c => c(App),
    router//1.4挂载路由对象到vm实例
})